type unpackedValue = 0;
unsignedType tempValue = (unsignedType)(0);
if (s.dataType)
{
	for (int i = 0; i < s.length; i++)
	{
		BITCALCULATEUNPACK(unsignedType);
		shift++;
		if (shift == 8)
		{
			shift = 0;
			startIndex++;
		}
	}
}
else
{
	for (int i = 0; i < s.length; i++)
	{
		BITCALCULATEUNPACK(unsignedType);
		shift++;
		if (shift == 8)
		{
			shift = 0;
			startIndex--;
		}
	}
}
unsignedType mask = (unsignedType)(1);
unsignedType bitValue = tempValue & (unsignedType)(mask << (s.length - 1));
if (bitValue != 0 && !s.is_unsigned)
{
	int len = 8 - s.length % 8;
	int tmp = (s.length / 8 + 1) * 8;
	for (int i = 0; i < len; i++)
	{
		tempValue = tempValue | (unsignedType)(mask << (tmp - i - 1));
	}
}
unpackedValue = (type)tempValue;
outValue = (real64_T)(unpackedValue);